package ebj.common.java8.datatime;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Calendar;
import java.util.Date;

public class InstantDemo {
    public static void main(String[] args) throws UnsupportedEncodingException {
        Calendar calendar = Calendar.getInstance();
        Instant instant = calendar.toInstant();
        Date date = Date.from(instant);
        System.out.println(LocalDate.now());
        System.out.println(LocalDateTime.now());
        System.out.println();
        String string = "http://172.20.0.69:8080/realquery/report?report_param={%22settings%22:{%22report_id%22:%221402919015%22,%22return_format%22:%22json%22,%22time%22:{%22start%22:1404086400,%22end%22:1404172799,%22timezone%22:0},%22data_source%22:%22ymds_druid_datasource%22,%22pagination%22:{%22size%22:100000,%22page%22:0}},%22filters%22:{%22$and%22:{}},%22data%22:[%22unique_click%22,%22click%22,%22conversion%22,%22rows%22],%22group%22:[%22aff_id%22,%22itvl_hour%22]}";
        System.out.println(URLDecoder.decode(string, "UTF-8"));
    }
}
